home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / Newton Platform Info / Newton 2.0 Sample Code / Modem Setup / Modem Setup-2 / Project Data < prev    next >
Encoding:
Text File  |  1995-11-22  |  10.6 KB  |  300 lines  |  [TEXT/NTP1]

  1. /*
  2. **      Modem Setup Installer v2.0
  3. **
  4. **        This project creates modem setups for use with the
  5. **        2.0 or later Newton Operating System ONLY.
  6. **
  7. **        Newton Developer Technical Support Sample Code
  8. **      Copyright © 1995 by Apple Computer, Inc.  All rights reserved.
  9. **
  10. **        To build your own modem setup...
  11. **        1)  Copy the entire project and rename the Project File appropriately.
  12. **        2)  Change the Package Name in Project Settings.
  13. **        3)  Edit the constants in Project Data for your modem.
  14. **        4)  Recompile and download.
  15. */
  16.  
  17. // ==================== MODEM GENERAL INFO ====================
  18.  
  19. constant kModemName := "Brand X Modem";
  20.     // type:    string
  21.     // range:    length > 0
  22.     //
  23.     // This is the name of the modem setup as seen in modem prefs.
  24.  
  25. constant kVersion := 1;
  26.     // type:    integer
  27.     // range:    positive 30-bit integer value
  28.     //
  29.     // Use ONLY integers for version numbers!!!  This number is
  30.     // compared to the currently installed modem setup version
  31.     // number (if any) to determine the appropriate wording for
  32.     // a user confirmation slip (see :MInstall() for more info).
  33.  
  34. constant kOrganization := "Apple Computer, Inc.";
  35.     // type:    string
  36.     // range:    length > 0
  37.     //
  38.     // Change this accordingly (for informational use).
  39.  
  40. // ===================== LOCALIZATION INFO ====================
  41. // To build localized modem setups, simply duplicate the
  42. // frame "Custom" below, name it according to the language you
  43. // are localizing to, and enter that name in the Language box
  44. // in Project Settings.  When you compile, the LocObj function
  45. // will use the appropriate strings according to the language
  46. // you have specified in Project Settings.
  47.  
  48. SetLocalizationFrame({
  49.         Custom:        {    fNotifyIncompatible:    "The \"" & kModemName & "\" modem setup is not compatible with this unit.",
  50.                         fConfirmNewer:            "You are about to install a NEWER version of the \"" & kModemName & "\" modem setup.  Continue?",
  51.                         fConfirmOlder:            "You are about to install an OLDER version of the \"" & kModemName & "\" modem setup.  Continue?",
  52.                         fConfirmSame:            "The \"" & kModemName & "\" modem setup is already installed.  Reinstall?",
  53.                     },
  54.     });
  55.  
  56. // =================== MODEM PREFS ENTRIES ====================
  57.  
  58. constant kIdModem := true;
  59.     // type:    boolean
  60.     // range:    nil, true
  61.     // default:    true
  62.     //
  63.     // If true, the Newton Modem Tool will execute an ID sequence
  64.     // in an attempt to identify the modem which is connected.
  65.     // If the modem is identified, the NMT configures the active
  66.     // modem profile accordingly.  The ID sequence is run when
  67.     // the Bind call is made to the NMT.  NOTE: the modem is reset
  68.     // during the ID sequence using the AT&F command.
  69.     // If nil, the NMT skips the ID sequence and configures the
  70.     // active profile to the default.  Modem is not reset.
  71.  
  72. constant kUseHardwareCD := true;
  73.     // type:    boolean
  74.     // range:    nil, true
  75.     // default:    true
  76.     //
  77.     // If true, the NMT will sense the CD line for determining loss
  78.     // of carrier.  External modems must use a cable which connects the
  79.     // CD RS-232 signal to the Newtons GPi serial pin (pin 7 on MP’s).
  80.     // If nil, CD is ignored.
  81.  
  82. constant kUseConfigString := true;
  83.     // type:    boolean
  84.     // range:    nil, true
  85.     // default:    true
  86.     //
  87.     // If true, before initiating a connection, send the current
  88.     // configuration string to the modem (as determined by active
  89.     // modem profile and the connection type).
  90.     // If nil, no configuration string is sent.
  91.     
  92. constant kUseDialOptions := true;
  93.     // type:    boolean
  94.     // range:    nil, true
  95.     // default:    true
  96.     //
  97.     // If true, before initiating a connection, after configString
  98.     // is sent to modem, set modem dialing configuration according
  99.     // to current option settings.
  100.     // If nil, dial configuration string is not sent to modem.
  101.     // Default dial config string:  "ATM1L2X4S7=060S8=001S6=003\n"
  102.  
  103. constant kHangUpAtDisconnect := true;
  104.     // type:    boolean
  105.     // range:    nil, true
  106.     // default:    true
  107.     //
  108.     // If true, when the NMT disconnects, hang up the modem.
  109.     // If nil, when the NMT disconnects, no commands are sent to the modem.
  110.  
  111.  
  112. // =================== MODEM PROFILE ENTRIES ==================
  113.  
  114. constant kSupportsEC := nil;
  115.     // type:    boolean
  116.     // range:    nil, true
  117.     // default:    nil
  118.     //
  119.     // If true, indicates modem supports built in error correction,
  120.     // and the profile contains configuration strings for error correction.
  121.  
  122. constant kSupportsLCS := nil;
  123.     // type:    boolean
  124.     // range:    nil, true
  125.     // default:    nil
  126.     //
  127.     // If true, indicates modem supports Line Current Sense.  LCS
  128.     // is used for determining when a user has lifted the phone
  129.     // handset off hook.  Applications take advantage of this
  130.     // feature by allowing the modem to determine when it
  131.     // should release the line for a voice call.
  132.     // If nil, the modem does not support LCS.  In this case,
  133.     // an application can use a dialog box and user interaction to
  134.     // determine when to tell the modem to release the line (ATH).
  135.  
  136. constant kDirectConnectOnly := true;
  137.     // type:    boolean
  138.     // range:    nil, true
  139.     // default:    true
  140.     //
  141.     // If true, indicates modem only supports direct connect mode
  142.     // and can't speed buffer.  In this case, for data connections,
  143.     // the DTE speed must be adjusted to the modem speed after the
  144.     // carrier is established. 
  145.     // If nil, indicates the modem supports speed buffering, and
  146.     // use of CTS flow control.
  147.     // NOTE:  For FAX connections, flow control is required! 
  148.     // The string kConfigStrNoEC is used to configure the modem
  149.     // for fax connections.  If kDirectConnectOnly is true,
  150.     // kConfigStrNoEC should enable software flow control.
  151.  
  152. constant kConnectSpeeds := '[300, 1200, 2400, 4800, 7200, 9600, 12000, 14400];
  153.     // type:    constant array of length > 0
  154.     // range:    each element a positive 30-bit integer value
  155.     // default:    '[300, 1200, 2400, 4800, 7200, 9600, 12000, 14400]
  156.     //
  157.     // Indicates speeds at which the modem can connect.  The value
  158.     // of kConnectSpeeds does NOT effect how the modem is
  159.     // configured.  The intention is to allow the application to
  160.     // read this value to determine the modem's capabilities.
  161.  
  162. constant kConfigSpeed := 19200;
  163.     // type:    integer
  164.     // unit:    bps
  165.     // range:    positive 30-bit integer value
  166.     // default:    19200
  167.     //
  168.     // (bps) speed at which to configure the modem
  169.  
  170. constant kCommandTimeout := 2000;
  171.     // type:    integer
  172.     // unit:    milliseconds
  173.     // range:    positive 30-bit integer value
  174.     // default:    2000
  175.     //
  176.     // (ms) how long we'll wait for modem response to a command before timing out
  177.  
  178. constant kMaxCharsPerLine := 40;
  179.     // type:    integer
  180.     // range:    positive 30-bit integer value
  181.     // default:    40
  182.     //
  183.     // Indicates maximum number of characters per command line, 
  184.     // NOT COUNTING "AT" and <cr>!  The modem controller uses this
  185.     // number to ensure the dial string does not exceed the modem's
  186.     // capability.  If the number of characters in the dial string
  187.     // exceeds this number, the dial string will be split into
  188.     // multiple commands, with ; appended to the intermediate
  189.     // dial string commands.
  190.  
  191. constant kInterCmdDelay := 25;
  192.     // type:    integer
  193.     // unit:    milliseconds
  194.     // range:    positive 30-bit integer value
  195.     // default:    25
  196.     //
  197.     // Indicates minimum amount of (ms) delay required between
  198.     // modem commands.  This is the time from the last response
  199.     // received to the next command sent.
  200.  
  201. constant kModemIDStr := nil;
  202.     // type:    string
  203.     // range:    nil, length > 0
  204.     // default:    nil
  205.     //
  206.     // Modem response to the ATI4 command.  If the modem responds
  207.     // with more than one result string, kModemIDStr should 
  208.     // contain only one result string.
  209.  
  210. constant kConfigStrNoEC := "ATE0&C1S12=12W2&K3&Q6\n";
  211.     // type:    string
  212.     // range:    nil, length > 0
  213.     // default:    "ATE0&C1S12=12W2&K3&Q6\n"
  214.     //
  215.     // Modem command string used to configure modem for a non-
  216.     // error corrected connection.  Uses speed buffering.  This
  217.     // string is used for FAX connections.
  218.  
  219.  constant kConfigStrECOnly := nil;
  220.     // type:    string
  221.     // range:    nil, length > 0
  222.     // default:    nil
  223.     //
  224.     // Modem command string used to configure the modem for an
  225.     // error corrected connection.  Uses speed buffering.  This
  226.     // string should be nil for modems that do not support error
  227.     // correction.
  228.  
  229.  constant kConfigStrECAndFallback := nil;
  230.     // type:    string
  231.     // range:    nil, length > 0
  232.     // default:    nil
  233.     //
  234.     // Modem command string used to negotiate for error correction.
  235.     // If error correction negotiation fails, the modem will fall
  236.     // back to a non-error corrected connection.  Uses speed
  237.     // buffering.  This string should be nil for modems that
  238.     // do not support error correction.
  239.  
  240. constant kConfigStrDirectConnect := "ATE0&C1S12=12W2&K0&Q0\n";
  241.     // type:    string
  242.     // range:    nil, length > 0
  243.     // default:    "ATE0&C1S12=12W2&K0&Q0\n"
  244.     //
  245.     // Modem command string used to configure the modem to connect
  246.     // in direct mode.  Speed buffering is disabled.  After
  247.     // connecting in data mode, the DTE speed will be adjusted to
  248.     // match the modem speed. 
  249.  
  250.  
  251. // ==================== FAX PROFILE ENTRIES ===================
  252.  
  253. constant kServiceClass := kModemFaxClass0 + kModemFaxClass1 + kModemFaxClass2 + 0x00000008;
  254.     // type:    integer
  255.     // range:    positive 30-bit integer value
  256.     // default:    kModemFaxClass0 + kModemFaxClass1 + kModemFaxClass2 + kModemFaxClass2_0
  257.     //
  258.     // Defines the fax service classes to consider when initiating the fax tool. 
  259.  
  260.  
  261. constant kTransmitDataMod :=    kV17st_14Mod + kV17_14Mod + kV17st_12Mod + kV17_12Mod +
  262.                                 kV17st_96Mod + kV17_96Mod + kV17st_72Mod + kV17_72Mod +
  263.                                 kV29_96Mod   + kV29_72Mod + kV27Ter48Mod + kV27Ter24Mod;
  264.     // type:    integer
  265.     // range:    positive 30-bit integer value
  266.     // default:    kV17st_14Mod + kV17_14Mod + kV17st_12Mod + kV17_12Mod +
  267.     //            kV17st_96Mod + kV17_96Mod + kV17st_72Mod + kV17_72Mod +
  268.     //            kV29_96Mod   + kV29_72Mod + kV27Ter48Mod + kV27Ter24Mod
  269.     //
  270.     // Defines the fax send speeds we are willing to negotiate. 
  271.  
  272. constant kReceiveDataMod := kV17st_14Mod + kV17_14Mod + kV17st_12Mod + kV17_12Mod +
  273.                             kV17st_96Mod + kV17_96Mod + kV17st_72Mod + kV17_72Mod +
  274.                             kV29_96Mod   + kV29_72Mod + kV27Ter48Mod + kV27Ter24Mod;
  275.     // type:    integer
  276.     // range:    positive 30-bit integer value
  277.     // default:    kV17st_14Mod + kV17_14Mod + kV17st_12Mod + kV17_12Mod +
  278.     //            kV17st_96Mod + kV17_96Mod + kV17st_72Mod + kV17_72Mod +
  279.     //            kV29_96Mod   + kV29_72Mod + kV27Ter48Mod + kV27Ter24Mod
  280.     //
  281.     // Defines the fax receive speeds we are willing to negotiate. 
  282.  
  283. constant kTransmitHDLCDataMod := kV21Ch2Mod;
  284.     // type:    integer
  285.     // range:    positive 30-bit integer value
  286.     // default:    kV21Ch2Mod
  287.     //
  288.     // Defines the speed at which the send HDLC frames are transmitted.
  289.     // This value will probably never be overridden. 
  290.  
  291. constant kReceiveHDLCDataMod := kV21Ch2Mod;
  292.     // type:    integer
  293.     // range:    positive 30-bit integer value
  294.     // default:    kV21Ch2Mod
  295.     //
  296.     // Defines the speed at which the receive HDLC frames are transmitted.
  297.     // This value will probably never be overridden. 
  298.  
  299. // ============================================================
  300.